<?php
//获取接口ID
$ap_id = $route->bodyParams['ap_id'];

//关闭事物自动提交
$db->mysqlDB->falseAutoCommit();

//删除接口请求参数信息
$deleteRequestParams = array(
    "delete_where"       => "rp_apid",
    "rp_apid"           => $ap_id,
    "isPhysicallyDelete" => "1"
);

//删除请求参数信息
$R1 = $db->mysqlDB->automaticDelete($deleteRequestParams)->delete("sys_request_parameter");

//删除原有权限
$deleteAction = array(
    "delete_where"       => "ap_id",
    "ap_id"           => $ap_id,
    "isPhysicallyDelete" => "1"
);

$R2 = $db->mysqlDB->automaticDelete($deleteAction)->delete("sys_action_permissions");

if ($R1 || $R2) {
    $db->mysqlDB->rollBackCommint();
    $response->responseData(false);
}else{
    $db->mysqlDB->actionCommint();
    $db->mysqlDB->trueAutoCommit();
    $response->responseData(true);
}